<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="父级条目ID" prop="parentItemId">
        <el-input
          v-model="queryParams.parentItemId"
          placeholder="请输入父级条目ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工作项标题" prop="title">
        <el-input
          v-model="queryParams.title"
          placeholder="请输入工作项标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工作项类型" prop="type">
        <el-select v-model="queryParams.type" placeholder="请选择工作项类型" clearable>
          <el-option
            v-for="dict in dict.type.work_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="项目ID" prop="projectId">
        <el-input
          v-model="queryParams.projectId"
          placeholder="请输入项目ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="指派人ID" prop="assignee">
        <el-input
          v-model="queryParams.assignee"
          placeholder="请输入指派人ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="风险等级" prop="risk">
        <el-select v-model="queryParams.risk" placeholder="请选择风险等级" clearable>
          <el-option
            v-for="dict in dict.type.work_risk"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="业务价值" prop="businessValue">
        <el-select v-model="queryParams.businessValue" placeholder="请选择业务价值" clearable>
          <el-option
            v-for="dict in dict.type.actual_value"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="故事点数" prop="storyPoints">
        <el-input
          v-model="queryParams.storyPoints"
          placeholder="请输入故事点数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="预估工时" prop="estimatedWorkingHours">
        <el-input
          v-model="queryParams.estimatedWorkingHours"
          placeholder="请输入预估工时"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="登记工时" prop="registerWorkingHours">
        <el-input
          v-model="queryParams.registerWorkingHours"
          placeholder="请输入登记工时"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="剩余工时" prop="surplusWorkingHours">
        <el-input
          v-model="queryParams.surplusWorkingHours"
          placeholder="请输入剩余工时"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="版本号" prop="version">
        <el-input
          v-model="queryParams.version"
          placeholder="请输入版本号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划开始日期" prop="startDate">
        <el-date-picker clearable
                        v-model="queryParams.startDate"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择计划开始日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="计划完成日期" prop="dueDate">
        <el-date-picker clearable
                        v-model="queryParams.dueDate"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择计划完成日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="优先级" prop="priority">
        <el-select v-model="queryParams.priority" placeholder="请选择优先级" clearable>
          <el-option
            v-for="dict in dict.type.priority"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="工作项状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择工作项状态" clearable>
          <el-option
            v-for="dict in dict.type.work_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="发布id" prop="releaseId">
        <el-input
          v-model="queryParams.releaseId"
          placeholder="请输入发布id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实际完成时间" prop="completedAt">
        <el-date-picker clearable
                        v-model="queryParams.completedAt"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择实际完成时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="关联的迭代ID" prop="sprintId">
        <el-input
          v-model="queryParams.sprintId"
          placeholder="请输入关联的迭代ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="完成者ID" prop="completedBy">
        <el-input
          v-model="queryParams.completedBy"
          placeholder="请输入完成者ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="子任务总数" prop="childCount">
        <el-input
          v-model="queryParams.childCount"
          placeholder="请输入子任务总数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="需求类型" prop="requirementType">
        <el-select v-model="queryParams.requirementType" placeholder="请选择需求类型" clearable>
          <el-option
            v-for="dict in dict.type.requirement_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="已完成子任务数" prop="childCompletedCount">
        <el-input
          v-model="queryParams.childCompletedCount"
          placeholder="请输入已完成子任务数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="进度" prop="progress">
        <el-input
          v-model="queryParams.progress"
          placeholder="请输入进度"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createdAt">
        <el-date-picker clearable
                        v-model="queryParams.createdAt"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="创建人ID" prop="createdBy">
        <el-input
          v-model="queryParams.createdBy"
          placeholder="请输入创建人ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新时间" prop="updatedAt">
        <el-date-picker clearable
                        v-model="queryParams.updatedAt"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择更新时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="更新人ID" prop="updatedBy">
        <el-input
          v-model="queryParams.updatedBy"
          placeholder="请输入更新人ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['project:work:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['project:work:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['project:work:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['project:work:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="workList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="工作项ID" align="center" prop="workItemId" />
      <el-table-column label="父级条目ID" align="center" prop="parentItemId" />
      <el-table-column label="工作项标题" align="center" prop="title" />
      <el-table-column label="工作项类型" align="center" prop="type">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.work_type" :value="scope.row.type"/>
        </template>
      </el-table-column>
      <el-table-column label="项目ID" align="center" prop="projectId" />
      <el-table-column label="项目名称" align="center" prop="projectName" />
      <el-table-column label="指派人ID" align="center" prop="assignee" />
      <el-table-column label="风险等级" align="center" prop="risk">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.work_risk" :value="scope.row.risk"/>
        </template>
      </el-table-column>
      <el-table-column label="业务价值" align="center" prop="businessValue">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.actual_value" :value="scope.row.businessValue"/>
        </template>
      </el-table-column>
      <el-table-column label="故事点数" align="center" prop="storyPoints" />
      <el-table-column label="预估工时" align="center" prop="estimatedWorkingHours" />
      <el-table-column label="登记工时" align="center" prop="registerWorkingHours" />
      <el-table-column label="剩余工时" align="center" prop="surplusWorkingHours" />
      <el-table-column label="版本号" align="center" prop="version" />
      <el-table-column label="计划开始日期" align="center" prop="startDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="计划完成日期" align="center" prop="dueDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="优先级" align="center" prop="priority">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.priority" :value="scope.row.priority"/>
        </template>
      </el-table-column>
      <el-table-column label="工作项状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.work_status" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column label="发布id" align="center" prop="releaseId" />
      <el-table-column label="实际完成时间" align="center" prop="completedAt" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.completedAt, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="关联的迭代ID" align="center" prop="sprintId" />
      <el-table-column label="完成者ID" align="center" prop="completedBy" />
      <el-table-column label="子任务总数" align="center" prop="childCount" />
      <el-table-column label="需求类型" align="center" prop="requirementType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.requirement_type" :value="scope.row.requirementType"/>
        </template>
      </el-table-column>
      <el-table-column label="已完成子任务数" align="center" prop="childCompletedCount" />
      <el-table-column label="进度" align="center" prop="progress" />
      <el-table-column label="创建时间" align="center" prop="createdAt" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建人ID" align="center" prop="createdBy" />
      <el-table-column label="更新时间" align="center" prop="updatedAt" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新人ID" align="center" prop="updatedBy" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['project:work:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['project:work:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改工作项对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="父级条目ID" prop="parentItemId">
          <el-input v-model="form.parentItemId" placeholder="请输入父级条目ID" />
        </el-form-item>
        <el-form-item label="工作项标题" prop="title">
          <el-input v-model="form.title" placeholder="请输入工作项标题" />
        </el-form-item>
        <el-form-item label="工作项类型" prop="type">
          <el-select v-model="form.type" placeholder="请选择工作项类型">
            <el-option
              v-for="dict in dict.type.work_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="项目ID" prop="projectId">
          <el-input v-model="form.projectId" placeholder="请输入项目ID" />
        </el-form-item>
        <el-form-item label="项目名称" prop="projectName">
          <el-input v-model="form.projectName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="指派人ID" prop="assignee">
          <el-input v-model="form.assignee" placeholder="请输入指派人ID" />
        </el-form-item>
        <el-form-item label="工作项描述">
          <editor v-model="form.description" :min-height="192"/>
        </el-form-item>
        <el-form-item label="风险等级" prop="risk">
          <el-select v-model="form.risk" placeholder="请选择风险等级">
            <el-option
              v-for="dict in dict.type.work_risk"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="业务价值" prop="businessValue">
          <el-select v-model="form.businessValue" placeholder="请选择业务价值">
            <el-option
              v-for="dict in dict.type.actual_value"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="故事点数" prop="storyPoints">
          <el-input v-model="form.storyPoints" placeholder="请输入故事点数" />
        </el-form-item>
        <el-form-item label="预估工时" prop="estimatedWorkingHours">
          <el-input v-model="form.estimatedWorkingHours" placeholder="请输入预估工时" />
        </el-form-item>
        <el-form-item label="登记工时" prop="registerWorkingHours">
          <el-input v-model="form.registerWorkingHours" placeholder="请输入登记工时" />
        </el-form-item>
        <el-form-item label="剩余工时" prop="surplusWorkingHours">
          <el-input v-model="form.surplusWorkingHours" placeholder="请输入剩余工时" />
        </el-form-item>
        <el-form-item label="版本号" prop="version">
          <el-input v-model="form.version" placeholder="请输入版本号" />
        </el-form-item>
        <el-form-item label="计划开始日期" prop="startDate">
          <el-date-picker clearable
                          v-model="form.startDate"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择计划开始日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="计划完成日期" prop="dueDate">
          <el-date-picker clearable
                          v-model="form.dueDate"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择计划完成日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="优先级" prop="priority">
          <el-select v-model="form.priority" placeholder="请选择优先级">
            <el-option
              v-for="dict in dict.type.priority"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="工作项状态" prop="status">
          <el-radio-group v-model="form.status">
            <el-radio
              v-for="dict in dict.type.work_status"
              :key="dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="发布id" prop="releaseId">
          <el-input v-model="form.releaseId" placeholder="请输入发布id" />
        </el-form-item>
        <el-form-item label="实际完成时间" prop="completedAt">
          <el-date-picker clearable
                          v-model="form.completedAt"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择实际完成时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="关联的迭代ID" prop="sprintId">
          <el-input v-model="form.sprintId" placeholder="请输入关联的迭代ID" />
        </el-form-item>
        <el-form-item label="完成者ID" prop="completedBy">
          <el-input v-model="form.completedBy" placeholder="请输入完成者ID" />
        </el-form-item>
        <el-form-item label="子任务总数" prop="childCount">
          <el-input v-model="form.childCount" placeholder="请输入子任务总数" />
        </el-form-item>
        <el-form-item label="需求类型" prop="requirementType">
          <el-select v-model="form.requirementType" placeholder="请选择需求类型">
            <el-option
              v-for="dict in dict.type.requirement_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="已完成子任务数" prop="childCompletedCount">
          <el-input v-model="form.childCompletedCount" placeholder="请输入已完成子任务数" />
        </el-form-item>
        <el-form-item label="进度" prop="progress">
          <el-input v-model="form.progress" placeholder="请输入进度" />
        </el-form-item>
        <el-form-item label="创建人ID" prop="createdBy">
          <el-input v-model="form.createdBy" placeholder="请输入创建人ID" />
        </el-form-item>
        <el-form-item label="更新人ID" prop="updatedBy">
          <el-input v-model="form.updatedBy" placeholder="请输入更新人ID" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listWork, getWork, delWork, addWork, updateWork } from "@/api/projectAdmin/work";

export default {
  name: "Work",
  dicts: ['work_status', 'actual_value', 'work_type', 'priority', 'requirement_type', 'work_risk'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 工作项表格数据
      workList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        parentItemId: null,
        title: null,
        type: null,
        projectId: null,
        projectName: null,
        assignee: null,
        description: null,
        risk: null,
        businessValue: null,
        storyPoints: null,
        estimatedWorkingHours: null,
        registerWorkingHours: null,
        surplusWorkingHours: null,
        version: null,
        startDate: null,
        dueDate: null,
        priority: null,
        status: null,
        releaseId: null,
        completedAt: null,
        sprintId: null,
        completedBy: null,
        childCount: null,
        requirementType: null,
        childCompletedCount: null,
        progress: null,
        createdAt: null,
        createdBy: null,
        updatedAt: null,
        updatedBy: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        title: [
          { required: true, message: "工作项标题不能为空", trigger: "blur" }
        ],
        type: [
          { required: true, message: "工作项类型不能为空", trigger: "change" }
        ],
        projectId: [
          { required: true, message: "项目ID不能为空", trigger: "blur" }
        ],
        status: [
          { required: true, message: "工作项状态不能为空", trigger: "change" }
        ],
        progress: [
          { required: true, message: "进度不能为空", trigger: "blur" }
        ],
        createdAt: [
          { required: true, message: "创建时间不能为空", trigger: "blur" }
        ],
        createdBy: [
          { required: true, message: "创建人ID不能为空", trigger: "blur" }
        ],
        updatedAt: [
          { required: true, message: "更新时间不能为空", trigger: "blur" }
        ],
        updatedBy: [
          { required: true, message: "更新人ID不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询工作项列表 */
    getList() {
      this.loading = true;
      listWork(this.queryParams).then(response => {
        this.workList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        workItemId: null,
        parentItemId: null,
        title: null,
        type: null,
        projectId: null,
        projectName: null,
        assignee: null,
        description: null,
        risk: null,
        businessValue: null,
        storyPoints: null,
        estimatedWorkingHours: null,
        registerWorkingHours: null,
        surplusWorkingHours: null,
        version: null,
        startDate: null,
        dueDate: null,
        priority: null,
        status: null,
        releaseId: null,
        completedAt: null,
        sprintId: null,
        completedBy: null,
        childCount: null,
        requirementType: null,
        childCompletedCount: null,
        progress: null,
        createdAt: null,
        createdBy: null,
        updatedAt: null,
        updatedBy: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.workItemId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加工作项";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const workItemId = row.workItemId || this.ids
      getWork(workItemId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改工作项";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.workItemId != null) {
            updateWork(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addWork(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const workItemIds = row.workItemId || this.ids;
      this.$modal.confirm('是否确认删除工作项编号为"' + workItemIds + '"的数据项？').then(function() {
        return delWork(workItemIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('project/work/export', {
        ...this.queryParams
      }, `work_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
